/*
    author: HeHy/watercutter
    date: 240719
    brief: software abstract layer for platform without q-spi protocol periphal
*/

#ifndef _SAL_QSPI_MOD_H
#define _SAL_QSPI_MOD_H

#define SAL_QSPI_CS_MAX_NUM (8)

typedef enum _SAL_QSPI_PIN_LEVEL{
    _STAUS_HIGH_LEVEL = 0xAAAAAAAA,
    _STATUS_LOW_LEVEL = 0x55555555,
}_SAL_QSPI_PIN_LEVEL;

typedef struct sal_qspi_info_{
    unsigned int cs_num_;
    unsigned int cs_pins_[SAL_QSPI_CS_MAX_NUM];
    unsigned int clk_pin_;
    unsigned int dat_pins_[4];
}sal_qspi_info_t;

void 
sal_qspi_init(
    sal_qspi_info_t* sal_qspi_dev_,
    unsigned long long cs_num,
    // _SAL_QSPI_PIN_LEVEL cs_default_status_, 
    // _SAL_QSPI_PIN_LEVEL clk_defaulte_status_, 
    void(*delay_us_)(unsigned int us_),
    void(*set_pin_val_)(unsigned int pin_, unsigned int val_)
); // register delay call back function, reset gpio pin output 

void 
sal_qspi_wdat_64bit(
    sal_qspi_info_t* sal_qspi_dev_,
    unsigned long long csn_,
    unsigned long long dat_,
    unsigned long long bits_num_
);

#endif /* _AL_QSPI_MOD_H */